home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 6180 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.3 KB

  1. Path: mail2news.demon.co.uk!genesis.demon.co.uk
  2. From: Lawrence Kirby <fred@genesis.demon.co.uk>
  3. Newsgroups: comp.lang.c
  4. Subject: Re: How to tell if a file exists in C
  5. Date: Thu, 22 Feb 96 22:58:05 GMT
  6. Organization: none
  7. Message-ID: <825029885snz@genesis.demon.co.uk>
  8. References: <4eqkj6$ipo@charm.magnus.acs.ohio-state.edu> <4eqn9q$dr1@sparcserver.lrz-muenchen.de> <3121db3e.43150046@nntp.ix.netcom.com> <4ftpnk$i74@cafu.fl.net.au> <824493561snz@genesis.demon.co.uk> <4g8132$mg9@cafu.fl.net.au> <4ggsa4$cdp@news.manawatu.gen.nz>
  9. Reply-To: fred@genesis.demon.co.uk
  10. X-NNTP-Posting-Host: genesis.demon.co.uk
  11. X-Newsreader: Demon Internet Simple News v1.27
  12. X-Mail2News-Path: genesis.demon.co.uk
  13.  
  14. In article <4ggsa4$cdp@news.manawatu.gen.nz>
  15.            ctutty@manawatu.gen.nz "Chris Tutty" writes:
  16.  
  17. >als@fl.net.au (Andrew Snow) wrote:
  18. >>Lawrence Kirby <fred@genesis.demon.co.uk> wrote:
  19. >>>In article <4ftpnk$i74@cafu.fl.net.au> als@fl.net.au "Andrew Snow" writes:
  20. >>>>If you want to see if the file is readable as well as exists,
  21. >>>Can a file be readable yet not exist?
  22. >>No, but did you really want me to spell it out?  You ought to have
  23. >>been able to figure it out. Sorry if you couldn't.
  24. >>
  25. >That's what I need!!! :-)  Non-existent readable files.  Simplify your
  26. >testing, avoid cluttering your hard drive with files called
  27. >TEMP001.TMP!.   Yeah!  
  28.  
  29. That is already possible in, say, Unix where a file can exist
  30. without a link (i.e. an entry in the directory structure). tmpfile()
  31. might generate such a file. However it still isn't something that would
  32. register for R_OK but not F_OK with access().
  33.  
  34. ...
  35.  
  36. >Well, actually I know what you mean, but I'm not sure that Mr Kirby's
  37. >'Can a file be readable but not exist' is actually impossible.  I
  38. >remember a situation connecting to a server from Windows where a user
  39. >could save files to the server, but didn't have rights to view the
  40. >directory.  The file was writable (and therefore readable)
  41.  
  42. It doesn't follow in general that writable files are readable (although
  43. it may do on a particular system).
  44.  
  45. >as long as
  46. >it was open, but once closed, it no longer existed for that person.
  47.  
  48. However as soon as it ceases to exist it ceases to be readable.
  49.  
  50. -- 
  51. -----------------------------------------
  52. Lawrence Kirby | fred@genesis.demon.co.uk
  53. Wilts, England | 70734.126@compuserve.com
  54. -----------------------------------------
  55.